proc sndnote {nick handle otbn1 botnet2 host chan} {
  global botnick home botadmin 

  if {$otbn1 == ""} {
    putquick "NOTICE $nick :\0034ERROR - You need to specify a recipient."
    return 0
  } elseif {$botnet2 == ""} {
    putquick "NOTICE $nick :\0034ERROR - You need to specify a message to send to '\002$otbn1\002'" 
    return 0
  }

  if {[onchan $otbn1 $chan]} {
    set hand2 [nick2hand $otbn1 $chan]
  } elseif {[validuser $otbn1]} {
    set hand2 $otbn1
  } else {
    putquick "NOTICE $nick :\0034ERROR - '\002$otbn1\002' could not be found any of the channels this bot is in or in this bot's user access files."
    return 0
  } 
  set result [sendnote $handle $hand2 $botnet2]

  # These are apparently errorhandlers
  if {$result == "0"} {
    putquick "NOTICE $nick :\0034ERROR - Delivery Failed - This note cannot be sent to \002$otbn1\002 at this time."  
    return 0
  } elseif {$result == "1"} {  
    putquick "NOTICE $nick :\0033Success - Message delivered to \002\00312$otbn1\002\0033 (\0034$hand2\0033)"        
    return 0
  } elseif {$result == "2"} {
    putquick "NOTICE $nick :\0033Success - Message delivered to \002\00312$otbn1\002\0033 (\0034$hand2\0033)"        
    return 0
  } elseif {$result == "3"} {
    putquick "NOTICE $nick :\0034ERROR - \002$hand2\002's virtual notebox is currently full therefore your message could not be delivered."
    return 0
  } elseif {$result == "4"} {
    putquick "NOTICE $nick :\0034Message Intercepted - \0033This message has been handled by another script on this bot.  If you suspect this third party script is not working properly, contact $botadmin"
    return 0
  } elseif {$result == "5"} {
	# This code was funny enough I decided to keep a relic of the old code commented for all to laugh at:
	#
	#     puthelp "NOTICE $nick :ERROR - Success - Message delivered sucessfully to \002$otbn1\002's ($hand2) notebox."
	# 		- Code by Bot-Solutions / Intel (Krish Ahya)
	#	
    putquick "NOTICE $nick :\0033Success - Message delivered to \002\00312$otbn1\002\0033 (\0034$hand2\0033)"
    putquick "NOTICE $nick :\0033Note, this user is currently away and therefore may not read your message immediately."
    return 0
  }
}










